import { Neo4jScheme } from "nest-neo4j/dist";

/**
 * @Description: 配置文件接口
 * @author zhaojiuyi
 * @date 2023/4/7
 */

export interface IConfig {
  /**
   * 后台管理jwt token密钥
   */
  jwt?: {
    secret: string;
    expiresIn: string;  // 过期时间
  };
  /*
  * 邮件配置
  * */
  mail?: {
    transport: {
      host: string,
      port: number,
      secure: boolean,
      auth: {
        user: string,
        pass: string
      },
    },
    defaults: {
      from: string,
    },
  },

  /**
   * 文件上传路径， 绝对路径  例如： E:/upload/test
   */
  uploadPath?: string;

  /**
   * 数据库配置
   */
  database?: {
    type: string;
    host: string;
    port: number | string;
    username?: string;
    password?: string;
    database?: string;
    autoLoadModels: boolean; // 如果为true，模型将自动载入（默认:false)
    synchronize?: boolean; //如果为true，自动载入的模型将同步
    logging?: any;
  };

  /**
   * redis 配置
   */
  redis?: {
    config: {
      host: string,
      port: number,
      password?: string,
      db?: string | number
      // url: string;
    };
  };

  /**
   * neo4j配置
   * */
  neo4j?: {
    scheme: Neo4jScheme;
    host: string;
    port: number;
    username: string;
    password: string;

  };

  /* mongoose */
  mongoose?: {
    uri: string
  }

  /* 队列配置 */
  bullRedis?: {
    host: string;
    port: string;
    password: string;
  };

  /* 是否演示环境 */
  isDemoEnvironment?: boolean;
}
